import Vue from 'vue';
import router from './router';
import App from './App';
import store from './store/store';
import VueResource from 'vue-resource';
import minxin from './minxin/minxin.js';
import './components/index';
import util from './assets/js/uitl';
import FastClick from 'fastclick';
import './assets/style/gloabl.less';
Vue.use(VueResource);
Vue.mixin(minxin);
Vue.prototype.$util = util;
util.appendEmByWidth();
router.beforeEach(function(to, from, next) {
  if(from.name){
      store.state.isFirstPage = false; 
  }
  store.commit('UPDATE_DIRECTION', to.params.direction ? to.params.direction : 'forward');
  next();
});
FastClick.attach(document.body);//点击300ms延迟
Vue.config.productionTip = false;
window.rootApp = new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
});
